﻿@using CoreData
@using Helper
@model IEnumerable<Product>
@if (Model != null && Model.Count() > 0)
{   
    <div class="grid-view">
        <div class="grid-title">
            <h3>
                Bạn muốn mua thêm</h3>
        </div>
        <ul class="row-product">
            @foreach (var item in Model)
            {
                <li class="column-product">
                    <div class="column-inner">
                        <div class="product-thumbnail">
                            <a href="@Url.RouteUrl("product_details", new { Id = item.ID, Link = item.Link })" title="@item.Name">
                                <img src="/Media/Product/@item.Image" alt="@item.Image" />
                            </a>
                        </div>
                        <div class="tool-payment">
                            <a href="@Url.Action("BuyNow", "ShoppingCart", new { ProductId = item.ID, Amount = 1 })" class="btn gray btn-pay">
                                Mua ngay</a>
                            <input type="button" ProductId="@item.ID" Amount="1" type="button" class="btn btn-add-cart" title="Thêm vào giỏ hàng">
                        </div>
                        <div class="product-details">
                            @{
                var productname = item.Name;
                if (productname.Length > 25)
                {
                    productname = productname.Substring(0, 25) + "...";
                }

                                <div class="product-price">
                                    <span>@StringHelper.FormatVND(int.Parse(item.Price.ToString()))</span></div>
                                <h1 class="product-title">
                                    <a href="@Url.RouteUrl("product_details", new { Id = item.ID, Link = item.Link })">@productname</a></h1>
                            }
                            <div class="small-detail">
                                <span class="detail-item">
                                    <label>
                                        Hạn dùng:</label><span>@item.Shelf</span></span> <span class="detail-item">
                                            <label>
                                                Xuất sứ:</label><span>Đà Lạt</span></span>
                            </div>
                        </div>
                    </div>
                </li>
            }
        </ul>
        <div class="clearfix">
        </div>
    </div>
}